package com.qinbaokeji.checkpoint.dahuacamera.config;


import com.qinbaokeji.checkpoint.dahuacamera.entity.CameraInfo;
import com.qinbaokeji.checkpoint.dahuacamera.service.ICameraInfoService;
import com.qinbaokeji.checkpoint.dahuacamera.service.ServiceFactory;

public class BeforeEndConfig {
    public BeforeEndConfig(CameraInfo cameraInfo){
        //模拟处理时间
        Thread t = new Thread(() -> {
            ICameraInfoService iCameraInfoService = (ICameraInfoService) ServiceFactory.getService("iCameraInfoService");
            cameraInfo.setPid(0);
            iCameraInfoService.updateById(cameraInfo);
        });
        Runtime.getRuntime().addShutdownHook(t);
    }
}
